import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {path:'/',redirect:'/dashbord'},
        {
            path: '/',
            name: '首页',
            component: (resolve) => require(['../components/common/Home.vue'], resolve),
            children:[
                {path:'/dashbord',meta:{title:'首页'},component:(resolve) =>require(['../components/page/Index.vue'],resolve) },
                {path:'/order/detail/:id',meta:{title:'订单详情'},component:(resolve) =>require(['../components/page/order/OrderDetail.vue'],resolve) },

                {path:'/store',meta:{title:'门店管理'},component:(resolve) =>require(['../components/page/store/Store.vue'],resolve) },
                {path:'/store/update/:id',meta:{title:'增加或修改'},component:(resolve) =>require(['../components/page/store/Update.vue'],resolve) },
                {path:'/store/detail/:id',meta:{title:'详情'},component:(resolve) =>require(['../components/page/store/Detail.vue'],resolve) },

                {path:'/center',meta:{title:'个人中心'},component:(resolve) =>require(['../components/page/center/Center.vue'],resolve) },
                {path:'/center/uppwd',meta:{title:'修改密码'},component:(resolve) =>require(['../components/page/center/UpdatePwd.vue'],resolve) },

                {path:'/center/balance',meta:{title:'佣金明细'},component:(resolve) =>require(['../components/page/center/Balance.vue'],resolve) },
                {path:'/center/incomelist/:type',meta:{title:'收入明细'},component:(resolve) =>require(['../components/page/center/IncomeList.vue'],resolve) },
                {path:'/center/withdraw/:type',meta:{title:'提现明细'},component:(resolve) =>require(['../components/page/center/Withdraw.vue'],resolve) },
                {path:'/center/withdrawdetail',meta:{title:'提现详情'},component:(resolve) =>require(['../components/page/center/WithdrawDetail.vue'],resolve) },
                {path:'/center/recommend',meta:{title:'推荐账户'},component:(resolve) =>require(['../components/page/center/Recommend.vue'],resolve) },
                {path:'/center/updateacccount',meta:{title:'推荐账户'},component:(resolve) =>require(['../components/page/center/UpdateAccount.vue'],resolve) },
                {path:'/center/withdrawdeposit',meta:{title:'提现'},component:(resolve) =>require(['../components/page/center/WithdrawDeposit.vue'],resolve) },
                {path:'/center/operatordescription',meta:{title:'操作说明'},component:(resolve) =>require(['../components/page/center/OperatorDescription.vue'],resolve) },
            
                
            ]
        },
        {path: '/login',component: resolve => require(['../components/page/Login.vue'], resolve)},
        {path: '*',redirect: '/404'}
    ]
})
